<template>
  <div class="view-container">
    <div class="project-header" v-text="projectInfo.projectName"></div>
    <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="基本信息" name="basic-info"></el-tab-pane>
      <el-tab-pane lazy label="进度计划" name="jin-du"></el-tab-pane>
      <el-tab-pane lazy label="工程招标" name="zhao-biao"></el-tab-pane>
      <el-tab-pane lazy label="工程合同" name="he-tong"></el-tab-pane>
      <el-tab-pane lazy label="工程变更" name="4"></el-tab-pane>
      <el-tab-pane lazy label="进度月报" name="5"></el-tab-pane>
      <el-tab-pane lazy label="工程造价" name="6"></el-tab-pane>
      <el-tab-pane lazy label="质量安全" name="7"></el-tab-pane>
      <el-tab-pane lazy label="竣工验收" name="8"></el-tab-pane>
      <el-tab-pane lazy label="工程资料" name="9"></el-tab-pane>
      <el-tab-pane lazy label="项目考勤" name="10"></el-tab-pane>
      <el-tab-pane lazy label="视频监控" name="11"></el-tab-pane>
      <el-tab-pane lazy label="环保检测" name="12"></el-tab-pane>
    </el-tabs>
    <div class="project-section">
      <router-view></router-view>
    </div>
    <div class="project-footer"></div>
  </div>
</template>

<script>
  import controllerAPI from '@/api/project/controller'
  export default {
    name: 'ProjectDetail',
    data() {
      return {
        projectInfo:{
          projectId:this.$route.params.id
        },
        activeName:'basic-info',
      }
    },
    created() {
      this.getInfo()
      this.$router.push('/project-info/project-detail/'+this.projectInfo.projectId+'/basic-info/'+this.projectInfo.projectId)
    },
    methods: {
      handleClick(val){
        this.activeName = val.name
        this.$router.push('/project-info/project-detail/'+this.projectInfo.projectId+'/'+val.name+'/'+this.projectInfo.projectId)
      },
      getInfo(){
        controllerAPI.getById(this.projectInfo.projectId).then(res=>{
          this.projectInfo = res.result
        })
      }
    }
  }
</script>

<style scoped lang="scss">



</style>
